package blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import blog.dao.BlogDao;
import blog.entity.Blog;
import blog.service.BlogService;
import blog.util.PageModel;

@Service
public class BlogServiceImpl implements BlogService {
	@Autowired
	private BlogDao blogDao;

	public BlogDao getBlogDao() {
		return blogDao;
	}

	public void setBlogDao(BlogDao blogDao) {
		this.blogDao = blogDao;
	}

	public boolean deleteBlog(int blogId) {
		return this.getBlogDao().deleteBlog(blogId);
	}

	public boolean deleteBlog(Blog blog) {
		return this.getBlogDao().deleteBlog(blog);
	}

	public Blog getBlog(int blogid) {
		return this.getBlogDao().getBlog(blogid);
	}

	public PageModel getBlog(int pageNo, int pageSize) {
		return this.getBlogDao().getBlog(pageNo, pageSize);
	}

	public PageModel getBlog(int cateid, int pageNo, int pageSize) {
		return this.getBlogDao().getBlog(cateid, pageNo, pageSize);
	}

	public boolean saveBlog(Blog blog) {
		return this.getBlogDao().saveBlog(blog);
	}

	public boolean updateBlog(Blog blog) {
		return this.getBlogDao().updateBlog(blog);
	}

}
